package com.dianmi.seckill.controller;

import com.dianmi.seckill.service.SeckillService;
import com.dianmi.seckill.vo.SeckillInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.awt.*;

/**
 * @author xieqiaofu
 * @date 2021/4/7
 */
@RequestMapping("/seckill")
@RestController
public class SeckillController {

    @Autowired
    private SeckillService seckillService;

    @PostMapping(value = "/do", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public String seckill(@RequestBody SeckillInfo seckillInfo) {
        return seckillService.seckill(seckillInfo);
    }
}
